home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
BASIC
/
0006.ZIP
/
SETMEM.BAS
< prev
next >
Wrap
BASIC Source File
|
1984-02-26
|
717b
|
21 lines
1 'ROUTINE TO SET MEMORY FROM BASIC
2 '
10 DEFINT A-Z
20 DEF SEG=&H40
30 KL = PEEK(&H13): KH = PEEK(&H14)
40 HAVE = KL + 256*KH
50 PRINT "You currently have" HAVE "kilobytes of main memory."
60 PRINT
70 INPUT "How many kilobytes will suffice";WANT
80 IF WANT = 0 THEN WANT = HAVE:GOTO 110 'ENTER alone gives status quo.
90 IF WANT < 35 THEN WANT = 35 'Ensure space for BASICA + AUTOEXEC.BAS.
100 IF WANT >320 THEN WANT = 320 'Current physical limit.
110 KL = WANT MOD 256: KH = WANT\256
120 POKE &H13,KL: POKE &H14,KH
130 WANT = WANT-64: IF WANT < 0 THEN WANT = 0
140 KL = WANT MOD 256: KH = WANT\256
150 POKE &H15,KL: POKE &H16,KH
160 SYSTEM
170 ' (still must reboot to let DOS adjust)
180 END